import { Component, Input, ChangeDetectionStrategy } from '@angular/core';

@Component({
  selector: 'app-profile-card',
  template: `
    <div>
      <app-profile-name [name]='profile.name'></app-profile-name>
      <app-profile-age [age]='profile.age'></app-profile-age>
    </div>
  `,
  // OnPush策略
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class ProfileCardComponent {
  @Input() profile: { name: string, age: number };
}
